package com.qlujavateam.sqloperation;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.qlujavateam.connection.connectSQL;

public class ToAccount {
	private connectSQL db = new connectSQL();

	/**
	 * 通过手机号码获取密码
	 *
	 * @param phoneNo
	 * @return
	 */
	public String getPassByPhoneNo(String phoneNo) {
		String pass = null;
		try {
			// String * from account where sphone='1111111'

			String sql = "select * from account where sphone='" + phoneNo
					+ "' ";

			ResultSet rs = db.query(sql);
			if (rs.next()) {
				pass = rs.getString("spass");
			}
			db.closeConn();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return pass;

	}

}
